Repository navigation
cuda: declare //cuda:toolchain_type and keep the toolchain hub private - #14521
Conversation
cuda/BUILD.bazel now loads no rules_cuda .bzl file: the cublas, cufft and curand component libraries move to //cuda/private and stay public as aliases. The CUDA toolchain_type moves from the hub to //cuda, the hub, check.bzl and the rules_cuda alias patch point at it, and the hub package is no longer public. Closes #14447 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/evidence platforms=["linux_x86_64"] task=test scope=//tools/testing/consumer:cold_start_test Generated by Claude Code |
|
Evidence started on |
|
The Generated by Claude Code |
|
Generated by Claude Code |
…fected plan tests() expands //patches/rules_cuda:coverage_keep_test and //cuda/tests:msvc_device_link_flags_test into @rules_cuda labels, and dx test rejects labels outside the main workspace, so the shard holding them failed with invalid_scope. The plan query now drops @repo labels and keeps the main-workspace suite that reaches them. Part of #14447 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Generated by Claude Code |
rdeps() preloads the transitive closure of every main-workspace test_suite, and on a widened plan that closure reaches a target that does not load, so the plan query failed. attr(tests, "@", $u) reads each suite's own tests list and needs no closure. Part of #14447 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Generated by Claude Code |
|
Generated by Claude Code |
|
Generated by Claude Code |
…out of check.bzl The aliases added an in-module alias that zero_compat_test rejects. cuda/BUILD.bazel now loads cuda_component_library from components.bzl and keeps the real cublas, cufft and curand targets. The only rules_cuda load on that path was CudaToolkitInfo in check.bzl, so cuda_toolkit_check moves to toolkit_check.bzl and //cuda loads no rules_cuda file. Part of #14447 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Shards 19, 11 and 22 on 9707d07 fail on main 8c9c770 without this change. These failures are not from this PR:
Shard 15 is the gazelle failure from my earlier comment. The Generated by Claude Code |
|
Generated by Claude Code |
pr-check.yml takes main's $t intersect //... plan query; pr_check_test asserts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xut2hw4aq9a55MtjjUhEzN
Closes #14447
toolchain_typeis declared in//cuda. The hub toolchains,cuda/private/toolchain/toolkit_check.bzlandpatches/rules_cuda/toolchain_type_alias.patchall point at//cuda:toolchain_type. The hub package default visibility is now//:__subpackages__.//cudaloads no rules_cuda file.cuda/BUILD.bazelnow loadscuda_component_libraryfrom//cuda/private:components.bzlinstead ofdefs.bzl, socublas,cufftandcurandstay real targets in//cudawith no aliases. That path used to reach rules_cuda only throughCudaToolkitInfoincheck.bzl, socuda_toolkit_checkmoves tocuda/private/toolchain/toolkit_check.bzl.bazel query 'buildfiles(//cuda:toolchain_type)'lists no@rules_cudafile. Its external repos (rules_cc,bazel_features,bazel_skylib,dx_pins_data) are already in everytools/testing/consumer/cold_start/*.txtlist.api/labels.txtanddocs/supported-surface.mdwere regenerated withbazel run //tools/api:update; they only add//cuda:toolchain_type.constant-globlint incuda/private/toolchain/BUILD.bazel.pr-check.yml: the affected-test plan used to expand//patches/rules_cuda:coverage_keep_testand//cuda/tests:msvc_device_link_flags_testinto@rules_cuda//...labels.dx testrejects those (invalid_scope). The plan query now drops@repolabels and keeps each main-repotest_suitewhose owntestslist names an@label (attr(tests, "@", $u)). That needs no transitive closure.tools/ci/pr_check_test.rschecks it.Tested:
//cuda/tests:all(the non-GPU, non-MSVC tests pass),//tools/testing:toolchain_gate_test,//tools/api:api_test,//tools/ci:workflow_files_testand//tools/ci:actionlint_testpassed.tools/dx test //patches/rules_cuda:coverage_keep_testpassed (3 tests). I ran the new plan query on//lua/... //cuda/... //patches/...and it succeeded. It returns 119 labels, including both suites, and no@label.tools/dx check --applyreports no findings on the touched files.Guard tests:
//tools/ci:zero_compat_test,rule_set_loads_test,unreferenced_files_test,starlark_docs_test,hub_literals_testandprose_rules_testfail on main 8c9c770. With this branch their logs report exactly the same problems as on main, so the branch adds none.//tools/testing:language_skeleton_testalso fails on main. With this change it no longer reportsprivate-visibility cuda/private/toolchain/hub. It still reportsregister-label cuda/private/toolchain/hub, becauseMODULE.bazelstill registers a//label, and this PR leaves that as it is.Evidence: https://github.com/devhusdk/rules_dx/actions/runs/44914285313 ran
//tools/testing/consumer:cold_start_teston linux_x86_64. No measured cold-start list fetchesrules_cuda. The test fails on main drift that this PR doesn't touch. go, java and rust newly fetchrules_dx++scala_config+dx_scala_toolchains(from #14441). go also newly fetchesrules_dx++dx_prebuilt+dx_prebuilt. go and rust no longer fetchrules_proto+.Other checks that fail on main 8c9c770 without this change:
analysis: thedx_crateslockfile is out of date.kotlin_screen_kotlinc_*tests.core/modulestests:consumer_deps_test,versions_contractandloaders_test, plus//config:workspace_policy.//elixir/tests/conformance:coverage_test.dx_docs_typescript_extract_testandlsp_headless_rust_analyzer_test.root_module_test,dx_nested_testandmodule_extension_srcs_test.//tools/ciguard tests.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xut2hxC83WkoJY8GRaHfFk